<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','admin');?>
<script type="text/javascript" src="<?php echo JS_PATH?>jquery.sgallery.js"></script>
<script type="text/javascript" src="<?php echo JS_PATH?>qrcode/jquery-1.11.1.js" ></script>
<script type="text/javascript" src="<?php echo JS_PATH?>qrcode/jquery.qrcode.js" ></script>
<script type="text/javascript" src="<?php echo JS_PATH?>qrcode/qrcode.js" ></script> 
<script type="text/javascript" src="<?php echo JS_PATH?>qrcode/utf.js" ></script>
<script>
    function change_color_over(title_id){
    	$("#"+title_id).css('color',"blue");
    }
    function change_color_out(title_id){
    	$("#"+title_id).css('color',"black");
    }
</script>
<div class="pad-lr-10">
<form name="searchform" action="" method="get">
		<input type="hidden" value="reg_child" name="m">
		<input type="hidden" value="manage" name="c">
		<input type="hidden" value="init" name="a">
		<?php if(isset($_GET['id'])){?>
			<input type="hidden" value="<?=$_GET['id']?>" name="id">
		<?php }?>
		<table width="100%" cellspacing="0" class="search-form">
			<tbody>
			<tr>
				<td>
					<div class="explain-col">
						<?php echo L('title');?>：<input name="title" type="text" value="<?php if(isset($_GET['title'])) {echo $_GET['title'];}?>"
										 class="input-text" style='width: 200px;' placeholder='输入标题关键字可模糊查询...'/>
						<input type="submit" name="search"  class="button" value="<?php echo L('search')?>" />
						<a style="float:right;cursor:pointer;" href="javascript:;" onclick="refreshData(4);" class="button">刷新数据</a>
					</div>
				</td>
			</tr>
			</tbody>
		</table>
	</form>
	
<div class="table-list">
    <table width="100%" cellspacing="0" >
        <thead>
            <tr>
			 <th width="20">ID</th>
            <th width="150"><?php echo L('title');?></th>
			<th width="80"><?php echo L('title_image');?></th>
            <th width="150"><?php echo L('description');?></th>
            <th width="40">类别</th>
            <th width="60">费用</th>
            <th width="80"><?php echo L('is_payed_online');?></th>
            <th width="80"><?php echo L('is_to_talent');?></th>
            <th width="60"><?php echo L('reg_num')?></th>
            <th width="80"><?php echo L('number')?></th>
            <!-- <th width="100"><?php echo L('qrcode')?></th> -->
            <th width="80"><?php echo L('updated_by')?></th>
            <th width="80"><?php echo L('update_time')?></th>
			<th width="180"><?php echo L('operations_manage');?></th>
            </tr>
        </thead>
    <tbody>
	<?php
	if(!empty($reg_info)) {
		foreach($reg_info as $r) {
	?>
    <tr>
		<td align='center'><?php echo $r['id']?></td>
		<td align='center'><!-- <a href="http://m.nsr.com.cn/xinsilu/v1/reg/toRegJsp?regTableInfoId=<?=$r['id']?>" id="title_<?php echo $r['id'];?>" target="_blank" onmouseover="change_color_over('title_'+<?php echo $r['id'];?>)" onmouseout="change_color_out('title_'+<?php echo $r['id'];?>)" title="点击可预览：<?php echo $r['title'];?>报名"> --><?php echo $r['title']?><!-- </a> --></td>
		<td align='center'><?php if ($r['title_image']){ ?><img src="<?php echo $r['title_image'];?>" height="60"/><?php }else{echo '<font color="red">（未设置）</font>';}?></td>
		<td align='center' title="<?=$r['description']?>">&nbsp;<?php echo $r['description']?str_cut($r['description'],120):'<font color="red">（未设置）</font>';?></td>
		<td align='center'><?php echo $r['reg_type'] ? $this->reg_type[$r['reg_type']] : '<font color="red">（未设置）</font>';?></td>
		<td align='center'><strong><?=$r['reg_fee']?$r['reg_fee'].'&nbsp;元':'(暂无数据)'?></strong></td>
		<td align='center'><?php if($r['is_payed_online']==1){echo '是';}elseif($r['is_payed_online']==2){echo '否';}else{echo '<font color="red">（未设置）</font>';}?></td>
		<td align='center'><?php if($r['is_to_talent']==1){echo '是';}elseif($r['is_to_talent']==2){echo '否';}else{echo '<font color="red">（未设置）</font>';}?></td>
		<td align='center'><?php echo $r['reg_num']?'<b>'.$r['reg_num'].'&nbsp;个</b>':'<b>0</b>&nbsp;个';?></td>
		<td align='center'><?php if($r['number']!=''){echo $r['number'];}else{echo '<font color="red">（未设置）</font>';}?></td>
		<!-- <td align="center"><a href="javascript:;" onclick="preview('http://m.nsr.com.cn/xinsilu/v1/reg/toRegJsp?regTableInfoId=<?=$r['id']?>')" title="点击生成<?php echo $r['title'];?>报名的二维码！">生成二维码</a></td> -->
		<td align='center'><?php echo $adminInfo[$r['updated_by']];?></td>
		<td align='center'><?php echo $r['update_time'];?></td>
		<td align='center'>
		<a href="javascript:edit('<?php echo $r['id']?>','<?php echo addslashes($r['title']);?>')"><?php echo L('edit');?></a>&nbsp;|&nbsp;<!-- 
		<a href="?m=reg_child&c=manage&a=delete&id=<?php //echo $r['id']?>&pc_hash=<?=$_SESSION['pc_hash']?>" onClick="return confirm('<?php //echo L('confirm')?>')"><?php //echo L('delete')?></a>&nbsp;|&nbsp; -->
		<a href="?m=reg_child&c=manage&a=reg_statistics&res_id=<?php echo $r['id']?>"><?php echo L('reg_statistics');?></a><!-- &nbsp;|&nbsp;
		<a href="?m=reg_child&c=manage&a=order_statistics&res_id=<?php echo $r['id']?>"><?php echo L('order_statistics');?></a> -->
		</td>
		
	</tr>
	<?php } 

	} else {
		echo "<tr><td colspan='13' style='color:red;font-size:18px;text-align:center;'><span>暂无数据！</span></td></tr>";
		}?>
    </tbody>
    </table>
   <div id="pages"><?php echo $pages;?>
  </div>
</div>
<div id="qrCodeDiv"></div>
<script type="text/javascript"> 
<!--
window.top.$('#display_center_id').css('display','none');
function edit(id, name) {
	window.top.art.dialog({id:'edit'}).close();
	window.top.art.dialog({title:'修改《'+name+'》',id:'edit',iframe:'?m=reg_child&c=manage&a=edit&pc_hash=<?=$_SESSION["pc_hash"]?>&id='+id,width:'780',height:'500'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;d.document.getElementById('dosubmit').click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
function model_delete(obj,id,name,items){
	if(items) {
		alert('<?php echo L('model_does_not_allow_delete');?>');
		return false;
	}
	window.top.art.dialog({content:name, fixed:true, style:'confirm', id:'model_delete'}, 
	function(){
	$.get('?m=content&c=sitemodel&a=delete&modelid='+id+'&pc_hash='+pc_hash,function(data){
				if(data) {
					$(obj).parent().parent().fadeOut("slow");
				}
			}) 	
		 }, 
	function(){});
};
function preview(url) {
	
	window.top.art.dialog({title:'二维码',fixed:true, iframe:'?m=sign_up&c=reg&a=qrcode&url='+url+'&pc_hash=<?=$_SESSION["pc_hash"]?>',width:'300',height:'210'});	

}
//-->
</script>
</body>
</html>
